<!-- 卡片>接处警 -->
<template>
<div class="pick-up-police">
  <!-- 进入接处警详情 -->
  <div class="card-title" @click="$Ctl.enterChild('ReceivingPolice',{ orgIds: orgIds })">
    <span class="card-title-text">接处警</span>
  </div>
  <div class="police-content">
    <!-- 动效图 -->
    <!-- <div></div> -->
    <!-- 未处理 -->
    <div class="police-item no-detail">
      <p class="police-title">未处理</p>
      <p class="police-num">{{noDetailNum}}</p>
    </div>
    <!-- 在处理 -->
    <div class="police-item detailing">
      <p class="police-title">在处理</p>
      <p class="police-num">{{detailingNum}}</p>
    </div>
    <!-- 已处理 -->
    <div class="police-item detailed">
      <p class="police-title">已处理</p>
      <p class="police-num">{{detailedNum}}</p>
    </div>
  </div>
</div>
</template>

<script>
import {getPoliceHandleCount} from "@/api/record";
export default {
  props: {
    orgId: {
      default() {
        return false
      }
    }
  },
  data() {
    return {
      noDetailNum: 0, // 未处理数量
      detailingNum: 0, // 在处理数量
      detailedNum: 0, // 已处理数量
      orgIds:this.orgId || this.$store.state.userInfo.organizationIds,
      isMuilUnitUser:this.$store.state.userInfo.isMuilUnitUser//0:单单位用户;1:多单位用户
    }
  },
  created() {
    let that = this
    getPoliceHandleCount({
      orgIds: that.orgIds,
      dataType:0
    }).then(res =>{
      that.noDetailNum=res.data.unHandlerCount || 0; // 未处理数量
      that.detailingNum=res.data.processingCount || 0; // 在处理数量
      that.detailedNum=res.data.handlerCount || 0;  //已处理数量
    })
    
    if(!that.isMuilUnitUser || (that.isMuilUnitUser && !that.orgId)){//推送只推一级首页
      window.FunList.pickUpPolice_ws = function(wsData){
        that.noDetailNum=wsData.noHandleNum || 0 // 未处理数量
        that.detailingNum=wsData.handlingNum || 0 // 在处理数量
        that.detailedNum=wsData.handledNum || 0  //已处理数量
      }
    }

  },
}

</script>
<style scoped rel="stylesheet/scss" lang="scss">
.pick-up-police {
  height: 100%;
  width: 100%;
  .police-content {
    position: relative;
    display: flex;
    padding-top: 30px;
    justify-content: space-around;
    background: url(../../assets/images/cards/jiechuj-gif.gif) center 13px no-repeat;
    background-size: 100%;
    &::before {
      position: absolute;
      top: 0;
      left: 0;
      content: '';
      width: 100%;
      height: 150px;
      background: url(../../assets/images/cards/halo.png) center 25px no-repeat;
      background-size: 100%;
      animation: halo 2s infinite linear;
    }
    .police-item {
      width: 117px;
      height: 228px;
      text-align: center;
      .police-title {
        margin-top: 170px;
        font-size: 18px;
        color: #A3BEDD;
      }
      .police-num {
        height: 30px;
        line-height: 30px;
        font-size: 28px;
      }
    }
    .no-detail {
      color: #d59449;
      background: url(../../assets/images/cards/yellow-stage.png) 0 0 no-repeat;
      background-size: 100%;
    }
    .detailing {
      margin-top: 50px;
      color: #5EB8F7;
      background: url(../../assets/images/cards/blue-stage.png) 0 0 no-repeat;
      background-size: 100%;
    }
    .detailed {
      color: #67B692;
      background: url(../../assets/images/cards/green-stage.png) 0 0 no-repeat;
      background-size: 100%;
    }
  }
}
</style>